﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Diploma.Models;

namespace DiplomaWeb.Models.Developer
{
    public class ChangeUserViewMode
    {
        public string SelectedUser { get; set; }

        public IEnumerable<SelectListItem> Users { get; set; }

        public void ToViewModel(IEnumerable<User> users)
        {
            Users = users.Select(r => new SelectListItem
                                          {
                                              Value = r.Email,
                                              Text = String.Format("{0} - {1}", r.Email, r.FullName)
                                          });
        }
    }
}